package java8;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by Administrator on 2022/10/20.
 */
public class StreamDemo {
    public static void main(String[] args) {
        List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd", "", "jkl");
        List<String> filtered = strings
                .stream()
                .filter(string -> !string.isEmpty())//内置的函数  x->x.length>0
                .sorted()

                .collect(Collectors.toList());
        System.out.println(filtered);
    }
}
